package com.ltedu.sms.controller;

import com.ltedu.common.vo.Result;
import com.ltedu.sms.service.SendSmsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @className: SendSmsController
 * @auther: Jerry
 * @date: 2020/11/20 16:43
 * @desctiption: TODO
 * @version: 1.0
 */
@RestController
@RequestMapping("/sms")
public class SendSmsController {

    @Autowired
    private SendSmsService sendSmsService;

    /**
     * 发送短信
     *
     * @param phone 电话
     * @return {@link Result}
     */
    @GetMapping("/sendSms/{phone}")
    public Result sendSms(@PathVariable String phone) {
        return sendSmsService.sendSms(phone);
    }
}
